// pages/familydoctor/category/category.js
var app =getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    navbar: ["平台服务包", "团队服务包"], 
    currentIndex: 0,
    packlist: [{
        title: "糖尿病服务包",
        img: 'https://img14.360buyimg.com/n2/s240x240_jfs/t24886/216/888717536/150820/d34c7002/5b7f5af2Nbde7f59b.jpg!q70.jpg'
      },
      {
        title: "高血压服务包",
        img: 'https://img14.360buyimg.com/n2/s240x240_jfs/t24886/216/888717536/150820/d34c7002/5b7f5af2Nbde7f59b.jpg!q70.jpg'
      },
      {
        title: "心脏病服务包",
        img: 'https://img14.360buyimg.com/n2/s240x240_jfs/t24886/216/888717536/150820/d34c7002/5b7f5af2Nbde7f59b.jpg!q70.jpg'
      },
      {
        title: "孕产妇服务包",
        img: 'https://img14.360buyimg.com/n2/s240x240_jfs/t24886/216/888717536/150820/d34c7002/5b7f5af2Nbde7f59b.jpg!q70.jpg'
      },
      {
        title: "脑血栓服务包",
        img: 'https://img14.360buyimg.com/n2/s240x240_jfs/t24886/216/888717536/150820/d34c7002/5b7f5af2Nbde7f59b.jpg!q70.jpg'
      },
    ],
  },
  navbarTab: function(e) {
    console.log(e.currentTarget.dataset.index)
    this.setData({
      currentIndex: e.currentTarget.dataset.index
    });
  },
  // 跳转详情
  packserver: function(e) {
    var that= this
    var t_id = that.data.t_id
    wx.navigateTo({
      url: '/hyb_yl/doctor/pages/familydoctor/serverpack/serverpack?id=' + e.detail.id + '&t_id=' + t_id,
    })
  },
  teampack: function(e) {
    wx.navigateTo({
      url: '/hyb_yl/doctor/pages/familydoctor/serverpack/serverpack?',
    })
  },
  //跳转添加服务包
  addserver: function() {
    wx.navigateTo({
      url: '/hyb_yl/doctor/pages/familydoctor/addpack/addpack',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    var that =this
    var t_id = options.t_id
    app.util.request({
      'url': 'entry/wxapp/Office.fllistdoc',
      success(res) {
        console.log(res)
        var list = res.data
        that.setData({
          packlist: res.data,
        })
      }
    })
    that.setData({
      t_id: t_id
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})